Repository navigation
Conversation
The variable c held the git commit result and then the git tag result. Use commit_result and tag_result so each name tells what it holds.
Move the two inline any() expressions out of the git.tag() call into should_sign_tag and should_annotate_tag.
The "no increment and same tag" condition was written twice in __call__. Move it to _is_not_eligible_for_bump. Move the commit retry condition to _should_retry_commit.
Move the changelog block into _update_changelog to make __call__ shorter. No change in behavior.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2130 +/- ##
=======================================
Coverage 98.29% 98.30%
=======================================
Files 61 61
Lines 2874 2884 +10
=======================================
+ Hits 2825 2835 +10
Misses 49 49 ☔ View full report in Codecov by Harness. |
9 of 10 tasks
Member
|
Hi thanks for this but it doesn't add any value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Behavior-preserving refactor of
Bump.__call__(172 lines, cyclomatic complexity 27). Part of #2129.ctocommit_resultandtag_result.any()expressions intoshould_sign_tagandshould_annotate_tag._is_not_eligible_for_bump, and the commit retry check into_should_retry_commit._update_changelog.One commit per change, so each step can be reviewed alone.
Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines. AI suggested the changes; I wrote and reviewed the code by hand.
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsExpected Behavior
No change. Same CLI output, files, commits, tags and exit codes as before.
Steps to Test This Pull Request
uv run poe all: 1351 passed, 3 skipped, 2 xfailed; coverage unchanged.pyproject.tomlcommitizen config, runcz bump --dry-runandcz bump --changelog --yes, and compare output and tag with the master branch.Additional Context
No new tests: the existing tests in
tests/commands/test_bump_command.pycover all changed paths. Pure refactor, so no docs change.